/* 
 * This file is part of CompetitionGenerator.
 * CompetitionGenerator is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * CompetitionGenerator is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * 
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with CompetitionGenerator. If not, see <http://www.gnu.org/licenses/>.
 */
package competitiongenerator.entities;

import java.util.Date;
import java.util.List;
import java.util.logging.Logger;

/**
 * Championship class.
 * @author Ashitaka
 * @date 11-abr-2009
 */
public class Championship {

    /**
     * Logger of the class Championship.
     */
    private final Logger logger = Logger.getLogger(Championship.class.getName());
    /**
     * The name of the championship.
     */
    private String championshipName;

    /**
     * The radio button corresponding the CompetitionForm for the days elapsed.
     */
    private enum radioButtonForDays {

        ONE {

            @Override
            public String toString() {
                return "One Day";
            }
        },
        THREE {

            @Override
            public String toString() {
                return "Three Days";
            }
        },
        FIVE {

            @Override
            public String toString() {
                return "Five Days";
            }
        },
        OTHER {

            @Override
            public String toString() {
                return "Other";
            }
        }
    };
    /**
     * The begginning date of the championship.
     */
    private Date championshipInitDate;
    /**
     * The end date of the championship.
     */
    private Date championshipEndDate;
    /**
     * The region where the championship will take place on.
     */
    private String championshipRegion;
    /**
     * The country where the championship will take place on.
     */
    private String championshipCountry;
    /**
     * The location where the championship will take place on.
     */
    private String championshipLocation;
    /**
     * The list of categories that will play on the championship.
     */
    private List<Category> championshipCategories;
    /**
     * The design of areas inside the competition place.
     */
    private List<CompetitionAreaKarate> championshipAreas;
    /**
     * The list of competitors in the championship.
     */
    private List<CompetitorKarate> competitorsList;

    /**
     * Void constructor.
     */
    public Championship() {
    }

    /**
     * Constructor.
     * @param championshipName
     * @param championshipLocation
     * @param championshipCountry
     * @param championshipRegion
     * @param championshipInitDate
     */
    public Championship(String championshipName, String championshipLocation, String championshipCountry, String championshipRegion, Date championshipInitDate) {
        this.championshipName = championshipName;
        this.championshipLocation = championshipLocation;
        this.championshipCountry = championshipCountry;
        this.championshipRegion = championshipRegion;
        this.championshipInitDate = championshipInitDate;
    }

    /**
     * Getter.
     * @return championshipAreas.
     */
    public List<CompetitionAreaKarate> getChampionshipAreas() {
        return championshipAreas;
    }

    /**
     * Setter.
     * @param championshipAreas.
     */
    public void setChampionshipAreas(List<CompetitionAreaKarate> championshipAreas) {
        this.championshipAreas = championshipAreas;
    }

    /**
     * Getter.
     * @return championshipCategories.
     */
    public List<Category> getChampionshipCategories() {
        return championshipCategories;
    }

    /**
     *  Setter.
     * @param championshipCategories.
     */
    public void setChampionshipCategories(List<Category> championshipCategories) {
        this.championshipCategories = championshipCategories;
    }

    /**
     * Getter.
     * @return championshipEndDate.
     */
    public Date getChampionshipEndDate() {
        return championshipEndDate;
    }

    /**
     * Setter.
     * @param championshipEndDate.
     */
    public void setChampionshipEndDate(Date championshipFinishDate) {
        this.championshipEndDate = championshipFinishDate;
    }

    /**
     * Getter.
     * @return championshipInitDate.
     */
    public Date getChampionshipInitDate() {
        return championshipInitDate;
    }

    /**
     * Setter.
     * @param championshipInitDate.
     */
    public void setChampionshipInitDate(Date championshipInitDate) {
        this.championshipInitDate = championshipInitDate;
    }

    /**
     * Getter.
     * @return championshipCountry.
     */
    public String getChampionshipCountry() {
        return championshipCountry;
    }

    /**
     * Setter.
     * @param championshipCountry.
     */
    public void setChampionshipCountry(String championshipCountry) {
        this.championshipCountry = championshipCountry;
    }

    /**
     * Getter.
     * @return championshipLocation.
     */
    public String getChampionshipLocation() {
        return championshipLocation;
    }

    /**
     * Setter.
     * @param championshipLocation.
     */
    public void setChampionshipLocation(String championshipLocation) {
        this.championshipLocation = championshipLocation;
    }

    /**
     * Getter.
     * @return championshipName.
     */
    public String getChampionshipName() {
        return championshipName;
    }

    /**
     * Setter.
     * @param championshipName.
     */
    public void setChampionshipName(String championshipName) {
        this.championshipName = championshipName;
    }

    /**
     * Getter.
     * @return championshipRegion.
     */
    public String getChampionshipRegion() {
        return championshipRegion;
    }

    /**
     * Setter.
     * @param championshipRegion.
     */
    public void setChampionshipRegion(String championshipRegion) {
        this.championshipRegion = championshipRegion;
    }

    /**
     * Getter.
     * @return competitorsList.
     */
    public List<CompetitorKarate> getCompetitorsList() {
        return competitorsList;
    }

    /**
     * Setter.
     * @param competitorsList.
     */
    public void setCompetitorsList(List<CompetitorKarate> competitorsList) {
        this.competitorsList = competitorsList;
    }

    
    /**
     * To String method.
     */
    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("--Championship--\nName: ");
        sb.append(getChampionshipName());
        sb.append(".\nInit Date: ");
        sb.append(getChampionshipInitDate());
        sb.append(".\nEnd Date: ");
        sb.append(getChampionshipEndDate());
        sb.append(".\nCountry: ");
        sb.append(getChampionshipCountry());
        sb.append(".\nRegion: ");
        sb.append(getChampionshipRegion());
        sb.append(".\nLocation: ");
        sb.append(getChampionshipLocation());
        sb.append(".\nCategories: ");
        for(int i=0;i<championshipCategories.size();i++){
            sb.append(championshipCategories.get(i).toString());
            if(i==championshipCategories.size()-1){
                sb.append(".");
            } else {                
                sb.append(", ");
            }
        }
        sb.append("\nNumber of Competitors: ");
        sb.append(competitorsList.size());
        sb.append(".\nNumber of Areas: ");
        sb.append(championshipAreas.size());
        return sb.toString();
    }
    
    
}
